import { Service } from "./request";

//修改密码
export function changePass(config: {
  phone: string;
  pass: string;
  md5c: string;
}) {
  const params = new URLSearchParams();
  params.append("phone", config.phone);
  params.append("pass", config.pass);
  params.append("md5c", config.md5c);

  return Service({
    url: "./api/changepass",
    data: params,
  });
}

//发送验证码
export function getTelCode(config: { phone: string }) {
  const params = new URLSearchParams();
  params.append("phone", config.phone);

  return Service({
    url: "./api/telcode",
    data: params,
  });
}

//密码登录
export function userLgn(config: { phone: string; pass: string }) {
  const params = new URLSearchParams();
  params.append("phone", config.phone);
  params.append("pass", config.pass);

  return Service({
    url: "./api/userlgn",
    data: params,
  });
}

//搜索车辆获取关键词
export function searchList(config: { page: string; mod: string }) {
  const params = new URLSearchParams();
  params.append("page", config.page);
  params.append("mod", config.mod);

  return Service({
    url: "./api/searchList",
    data: params,
  });
}

//汽车搜索
export function searchCar(config: { page: string; mod: string }) {
  const params = new URLSearchParams();
  params.append("page", config.page);
  params.append("mod", config.mod);

  return Service({
    url: "./api/searchCar",
    data: params,
  });
}

//获取所有品牌列表
export function oldMod(config: { phone: string }) {
  const params = new URLSearchParams();
  params.append("phone", config.phone);

  return Service({
    url: "./api/oldMod",
    data: params,
  });
}

//获取汽车列表
export function getCarList(config: { page: string }) {
  const params = new URLSearchParams();
  params.append("page", config.page);

  return Service({
    url: "./api/getCarList",
    data: params,
  });
}

//退出登录
export function signOut(config: { phone: string }) {
  const params = new URLSearchParams();
  params.append("phone", config.phone);

  return Service({
    url: "./api/signOut",
    data: params,
  });
}
